
int nSerial = 1;

void print_menu()
{
  Serial.println("Operations");
  Serial.println(" 1 - To change XBee rate");
  Serial.println(" 0 - return");
}

void print_rate()
{
  Serial.println("Change rate");
  Serial.println(" 1 - 1200");
  Serial.println(" 2 - 2400");
  Serial.println(" 3 - 4800");
  Serial.println(" 0 - return");
}

void setup()
{
  Serial.begin(9600);
  Serial1.begin(38400);

  Serial.println("Welcome in DFRobot XBee Bluetooth v2 tools");
  Serial.println("Be sure to setup your module in AT command");
  print_menu();
}

void loop()
{
  if(Serial.available())
  {
    int sb = Serial.read();
    switch(sb)
    {
    case '1':
      Serial.println("test AT");
      //Serial1.println("AT+BAUD8");
      //Serial1.println("AT");
      Serial1.print("AT+UART?");
      while (Serial1.available()>0)
      {
        Serial.print(Serial1.read());
      }
      break;
    case '0':
      break;
    default:
      print_menu();
      break;
    }
  }
}

